<?php
define('DS', '/');

$pathroot = dirname ( dirname ( __FILE__ ) );
Yii::setPathOfAlias('pathroot', $pathroot);

$frontend = $pathroot . DIRECTORY_SEPARATOR . 'source/apps/frontend/protected';
Yii::setPathOfAlias ( 'frontend', $frontend );

$backend = $pathroot . DIRECTORY_SEPARATOR . 'source/apps/backend/protected';
Yii::setPathOfAlias ( 'backend', $backend );

return array(
	'basePath'=> $frontend,
	'name'=>'Trung An',
	'preload'=>array('log'),
	//'id' => 'dbo.vn',
	'runtimePath' => $frontend . DIRECTORY_SEPARATOR . 'runtime',
	'theme' => 'trungan',	
	'modulePath' => $backend.'/modules',
	'language'	=> 'vi',
	'timezone' => 'Asia/Saigon',
	'import'=>array(
		'backend.components.*',
		'backend.modules.user.models.*',
		'backend.modules.user.components.*',
		'application.models.*',
		'application.components.*',
		'backend.modules.tracnghiem.models.*',
	),
	'modules'=>array(
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'123456',
			'ipFilters'=>array('127.0.0.1','::1'),
		),
		'user' => array(
			'debug' => false,
			'usersTable' => 'user',
			'translationTable' => 'translation',
			'mailer'=>'PHPMailer',
		),
		'profile' => array(
				'privacySettingTable' => 'privacy_setting',
				'profileFieldsGroupTable' => 'profile_field_group',
				'profileFieldsTable' => 'profile_field',
				'profileTable' => 'profile',
				'profileCommentTable' => 'profile_comment',
				'profileVisitTable' => 'profile_visit',
		),
		'api',
		'tracnghiem',
	),
	'components'=> CMap::mergeArray(
		array(
			'user'=>array(
				 'class' => 'backend.modules.user.components.YumWebUser',
			     'allowAutoLogin'=>true,
			     'loginUrl' => array('//site/login'),
			),
			'urlManager'=>array(
				'showScriptName' => false,	
				'urlFormat'=>'path',
				'rules'=>  CMap::mergeArray(
					array(),
					require(dirname(__FILE__).'/_partials/urls.php')
				),
			),
			'errorHandler'=>array(
				'errorAction'=>'site/error',
			),
			'log'=>array(
				'class'=>'CLogRouter',
				'routes'=>array(
					array(
						'class'=>'CFileLogRoute',
						'levels'=>'error, warning',
					),
				),
			),
			'assetManager' => array (
				'basePath' => dirname ( __FILE__ ) . '/../source/apps/frontend/assets/',
				'baseUrl' => '/source/apps/frontend/assets/'
			),
			'themeManager' => array (
				'basePath' => dirname ( __FILE__ ) . '/../themes/',
				'baseUrl' => '/themes/'
			),
			'CURL' =>array(
				'class' => 'backend.extensions.curl.Curl',
			),
			'cache' => array('class' => 'system.caching.CDummyCache'),
			'session'=>array(
				'class' => 'CDbHttpSession',
				'connectionID' => 'db_session',
				'sessionTableName' => 'dbo_session',
				'cookieMode' => 'allow',
				'cookieParams' => array(
					'path' => '/',
					'domain' => '.trungan.com',
				),
			),
		),
		require(dirname(__FILE__).'/_partials/config.php')
	),
	'params'=> CMap::mergeArray(
		array(
			'adminEmail'=> 'admin@dbo.vn',
			'noreplyEmail'	=>	'noreply@like.vn',
			'notRequireLogin' => array(
				'user/user/login',
				'user/auth',
				'user/auth/login',
			),
		),
		require(dirname(__FILE__).'/_partials/params.php')
	),
	'behaviors' => array(
		'onBeginRequest' => array(
	 		'class' => 'application.components.RequireLogin'
		)
	),
	
);